//
//  DailyFeatureTableViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/1/24.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "DailyFeatureTableViewCell.h"

@implementation DailyFeatureTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
    }
    return self;
}

- (void)tapAction:(UITapGestureRecognizer *)tap{
    
    NSLog(@"点我啊");
    
    
    
}

- (void)layoutSubviews{
    
    _image.image = [UIImage imageNamed:@"iconfont-youjiantou-2.png"];
    
    
    
    _LogoView.layer.cornerRadius = 3;
    _LogoView.layer.masksToBounds = YES;
    
    _logoView2.layer.cornerRadius = 3;
    _logoView2.layer.masksToBounds = YES;
    
    [super layoutSubviews];
    
}

- (void)awakeFromNib {
    
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"yeJianMoShi"] isEqualToString:@"isDay"]) {
        self.backgroundColor = DAYCOLOR;
    }else{
        self.backgroundColor = NIGHTCOLOR;
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"yeJianMoShi" object:nil];
}

- (void)changeColor:(NSNotification *)notification{
    
    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"yeJianMoShi"]isEqualToString:@"isNight"]) {
        self.backgroundColor = NIGHTCOLOR;
    }else{
        
        self.backgroundColor = DAYCOLOR;
    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
    
    [_LogoView release];
    [_label1 release];
    [_label2 release];
    [_image release];
    [_label3 release];
    [_logoView2 release];
    [_button release];
    [super dealloc];
}

- (IBAction)buttonAction:(id)sender {
    [self.delegate tapButtonJump];
    NSLog(@"513514543413435413331313");
    
}
@end
